<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	template="../include/template.xhtml">
	<ui:define name="pageTitle">
		<h:outputText value="搜索结果" />
	</ui:define>
	<ui:define name="logoTitle">
		<h:outputText value="搜索" />
	</ui:define>

	<ui:define name="content">
		<br />
		<h:outputText value="搜索结果[" class="strong" />
		<h:outputText
			value="#{indexAction_searchTasks.result.size()}#{indexAction_searchUsers.result.size()}"
			style="color:red;" />
		<h:outputText value="]条" class="strong" />
		<s:div style="float:right;">
			<h:outputText
				value="用时 [ #{indexAction_searchTasks.time}#{indexAction_searchUsers.time} ] 秒" />
		</s:div>
		<rich:separator lineType="double" height="2px" />
		<rich:spacer width="30px" />
		<s:div styleClass="right_center">
			<h:form>

				<rich:dataGrid id="isearchedtasks"
					value="#{indexAction_searchTasks.result}" columns="1" var="vtask"
					style="border-style:none;width:70%;" elements="10">
					<h:outputText value="#{vtask.id}." />
					<rich:spacer width="10px" />
					<h:outputText value="￥#{vtask.budget}元" />
					<rich:spacer width="10px" />
					<h:outputText
						value="#{searchAction.getHighlighterText('tag',vtask.tag)}"
						escape="false" />
					<rich:spacer width="10px" />
					<s:link view="/task/view.xhtml">
						<h:outputText
							value="#{searchAction.getHighlighterText('name',vtask.name)}"
							escape="false" />
						<f:param name="taskId" value="#{vtask.id}" />
						<f:param name="taskType" value="#{vtask.type}" />
					</s:link>
					<rich:spacer width="10px"></rich:spacer>
					<h:outputText value="[#{vtask.publishDate}]"></h:outputText>
					<br />
					<h:outputText value="项目描述:" />
					<h:outputText
						value="#{searchAction.getHighlighterText('description',vtask.description)}"
						escape="false" />
					<br />
					<h:outputText
						value="来源:#{vtask.url==null?'http://www.affectu.com/':vtask.url}" />
					<br />
					<rich:spacer height="16px"></rich:spacer>
				</rich:dataGrid>
				<rich:datascroller for="isearchedtasks"
					rendered="#{indexAction_searchTasks.result.size()>10}" align="left"
					maxPages="20">
				</rich:datascroller>


				<rich:dataGrid value="#{indexAction_searchUsers.result}" var="user"
					columns="2" width="100%">
					<h:panelGrid columns="2">
						<h:outputLink
							value="../upload/userFace/#{user.faceImage==null?'user3.gif':user.faceImage}">
							<h:graphicImage
								value="../upload/userFace/small_#{user.faceImage==null?'user3.gif':user.faceImage}"
								width="40" height="48"></h:graphicImage>
						</h:outputLink>
						<h:panelGroup>
							<h:outputText value="昵称:" />
							<s:link value="#{user.nickName}" view="/wike/viewDetail.xhtml"
								title="#{user.nickName}">
								<f:param name="userId" value="#{user.id}" />
							</s:link>
							<br />
							<h:outputText value="特长:" />
							<h:outputText value="#{user.specialty}" />
						</h:panelGroup>
					</h:panelGrid>
				</rich:dataGrid>

			</h:form>
		</s:div>



		<s:div styleClass="right_center" rendered="false">
			<h:form>
				<rich:dataGrid id="searchedtasks" value="#{searchedTasks}"
					columns="1" var="vtask" style="border-style:none;width:100%;"
					elements="4">
					<h:outputText value="#{vtask.id}." />
					<rich:spacer width="10px" />
					<s:link view="/task/view.xhtml">
						<h:outputText value="￥#{vtask.budget}元" />
						<rich:spacer width="10px" />
						<h:outputText value="#{vtask.tag}" escape="false" />
						<rich:spacer width="10px" />

						<h:outputText value="#{vtask.name}" escape="false" />
						<f:param name="taskId" value="#{vtask.id}" />
						<f:param name="taskType" value="#{vtask.type}" />
					</s:link>
					<rich:spacer width="10px"></rich:spacer>
					<h:outputText value="[#{vtask.publishDate}]"></h:outputText>
					<br />
					<h:outputText value="项目描述:" />
					<h:outputText
						value="#{indexAction.markedRedAtkeyWordsInHtml(vtask.description,160)}"
						escape="false" />
					<br />
					<h:outputText
						value="来源:#{vtask.url==null?'http://www.affectu.com/':vtask.url}" />
				</rich:dataGrid>
				<rich:datascroller for="searchedtasks" style="margin-left:-200px;"
					rendered="#{searchedTasks.size()>4}" maxPages="20">
				</rich:datascroller>

				<rich:dataGrid value="#{searchedUsers}" var="user" columns="2"
					width="100%">
					<h:panelGrid columns="2">
						<h:graphicImage
							value="../upload/userFace/#{user.faceImage==null?'user3.gif':user.faceImage}"></h:graphicImage>
						<h:panelGroup>
							<h:outputText value="昵称:" />
							<s:link value="#{user.nickName}" view="/wike/viewDetail.xhtml"
								title="#{user.nickName}">
								<f:param name="userId" value="#{user.id}" />
							</s:link>
							<br />
							<h:outputText value="特长:" />
							<h:outputText value="#{user.specialty}" />
						</h:panelGroup>
					</h:panelGrid>
				</rich:dataGrid>

			</h:form>
		</s:div>

	</ui:define>
</ui:composition>
